package me.sealer.java8.methodreference;

import java.io.File;
import java.util.Arrays;
import java.util.List;

/**
 * Created by sealer on 09-17-2017.
 */
public class MethodReference {
    public static void main(String[] args) {
        File[] hiddenFiles;
        /// 这是lambda表达式写法， 未注释的是方法引用写法
//        hiddenFiles = new File(".").listFiles(f -> f.isHidden());
        hiddenFiles = new File(".").listFiles(File::isHidden);

        if (hiddenFiles == null) {
            return;
        }
        List<File> files = Arrays.asList(hiddenFiles);
        files.forEach(f -> System.out.println(f.getName()));
    }
}
